/*
ID: icerupt1
PROG: shuttle
LANG: C++
*/

/* solution
 *
 * 找规律。
 *
*/

#include <fstream>
#include <iostream>
#include <queue>

std::ifstream fin ("shuttle.in" );
std::ofstream fout("shuttle.out");

std::queue<int> ans;

void print()
{
	for (int tot = 0; !ans.empty(); ans.pop(), tot++) {
		if (tot && !(tot % 20)) { std::cout << '\n'; fout << '\n'; }
		if (tot%20) { std::cout << ' '; fout << ' '; }
		std::cout << ans.front();
		fout << ans.front();
	}
	std::cout << '\n';
	fout << '\n';
}

int main()
{
	int n;
	fin >> n;
	int pos = n+1, period = 1, opt = -1;
	for (; period <= n; period++, opt = -opt) {
		for (int i = 0; i < period-1; i++) {
			pos += opt * 2;
			ans.push(pos);
		}
		pos += opt;
		ans.push(pos);
	}

	opt = ((n&1) ? 1: -1);
	period--;
	for (int i = 0; i < period; i++) {
		pos += opt * 2;
		ans.push(pos);
	}

	opt = -opt;
	for (; period > 0; period--, opt = -opt) {
		pos += opt;
		ans.push(pos);
		for (int i = 0; i < period-1; i++) {
			pos += opt * 2;
			ans.push(pos);
		}
	}

	print();
}

